﻿using T4UtilityBelt.Serializers;

namespace T4UtilityBelt.DataDesigns
{
    public class DecimalProperty : EntityProperty
    {

        private const string RequiredType = "decimal";
        private const string DefaultType = "decimal?";

        public DecimalProperty()
            : base(DefaultType)
        {
        }

        public DecimalProperty(string name)
            : base(DefaultType, name)
        {
        }

        public DecimalProperty(string name, bool required)
            : base(required ? RequiredType : DefaultType, name, required)
        {
        }

        public override UxDesigns.Control CreateControl()
        {
            // todo create a control for the DecimalProperty
            return null;
        }

        [XIgnore()]
        public override bool IsPropertyTypeSpecified
        {
            get
            {
                return DefaultType != PropertyType;
            }
        }
    }
}